function pieTootipCallback(params: any) {
  const { color, name, value, percent, seriesName } = params;
  return (
    `<div style="margin-bottom: 5px;"><span style="font-weight:bold;">${
      seriesName
    }</span></div>` +
    `<div><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${
      color
    };"></span>${name}：<span style="font-weight:bold;">${value} (${
      percent
    }%)` +
    `</span></div>`
  );
}

function barTootipCallback(title: string) {
  return function (params: any) {
    const { color, data, seriesIndex, seriesName } = params;
    return (
      `<div style="margin-bottom: 5px;"><span style="font-weight:bold;">${
        title
      }</span></div>` +
      `<div><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${
        color
      };"></span>${seriesName}：<span style="font-weight:bold;">${
        data[seriesIndex + 1]
      }</span></div>`
    );
  };
}

export { barTootipCallback, pieTootipCallback };
